package cn.icesky1stm.isblog.exception;

import cn.icesky1stm.isblog.enums.ResultEnum;

/**
 * @ClassName: IsBlogException <br>
 * @Description: 自定义异常 <br>
 * @Package: cn.icesky1stm.isblog.exception <br>
 * @author: suitianmou <br>
 * @Date: 2021/6/27-20:27 <br>
 * @version: 1.0 <br>
 * @see <br>
 * @since (从产品的哪一个版本此类被添加进来 ( 可选))<br>
 * 修改历史: <br>
 * 修改时间             修改人           版本变更           修改说明<br>
 * -----------------------------------------------------<br>
 * <br>
 */
public class IsBlogException extends RuntimeException {

    private Integer errorCode = ResultEnum.ERROR.getCode();

    public IsBlogException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.errorCode = resultEnum.getCode();
    }
    public IsBlogException(ResultEnum resultEnum, Throwable cause) {
        super(resultEnum.getMsg(), cause);
        this.errorCode = resultEnum.getCode();
    }
    public IsBlogException(Integer errorCode, String msg) {
        super(msg);
        this.errorCode = errorCode;
    }

    public IsBlogException(String msg) {
        super(msg);
    }

    public Integer getErrorCode() {
        return errorCode;
    }

}
